package com.lj.admin.controller.system;

import com.lj.common.core.ajax.Result;
import com.lj.common.core.controller.BaseController;
import com.lj.system.service.ISysConfigService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统配置前端控制器
 *
 * @author 小李飞刀
 */
@RequestMapping("system/config")
@RestController
public class SysConfigController extends BaseController {

    @Resource
    private ISysConfigService configService;

    /**
     * 根据参数键名查询参数值
     *
     * @param configKey 键值
     * @return 配置值
     */
    @GetMapping(value = "/configKey/{configKey}")
    public Result getConfigKey(@PathVariable String configKey) {
        return Result.success(configService.selectConfigByKey(configKey));
    }
}
